<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<ui:param name="pageName" value="Assets In Process"></ui:param>
	<ui:define name="sidebar">
	<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
	
		<h:form>
		    <h:outputText value="Asset Requests (for Approval)" styleClass="outputTextTitle"/>
		<p:growl />
			
			<p:tabView id="tabView" > 
				 
				<p:tab id="tab1" title="Inprocess" >  
					
				  <p:dataTable value="#{approverInprocessAssetsBean.assetRequestInprocess}" var="assetRequest" paginator="true" rows="25">  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{assetRequest.sno}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{assetRequest.employee.firstName} #{assetRequest.employee.lastName}" />  
		            </p:column>
		            
		             <p:column headerText="Request Date">
		                <h:outputText value="#{assetRequest.requestDate}" >
		                	<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{approverInprocessAssetsBean.timeZone}"/>
		                </h:outputText>  
		            </p:column>  
		            
		            <p:column headerText="Asset Code">
		                <h:outputText value="#{assetRequest.assetReferenceCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{assetRequest.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approver Status">
		                <h:outputText value="#{assetRequest.approverStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{approverInprocessAssetsBean.assetRequestApproveAction}" value="Recommend" >			
							<f:param name="assetCode" value="#{assetRequest.assetReferenceCode}" />							
							<f:param name="activity" value="byApprover" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab2" title="Approved" >  
					
				  <p:dataTable paginator="true" rows="25" value="#{approverInprocessAssetsBean.assetRequestApproved}" var="assetRequest" >  
	  
		            <p:column headerText="S.No"> 
		                <h:outputText value="#{assetRequest.sno}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{assetRequest.employee.firstName} #{assetRequest.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Request Date">
		                <h:outputText value="#{assetRequest.requestDate}" >
		                	<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{approverInprocessAssetsBean.timeZone}"/>
		                </h:outputText>  
		            </p:column> 
		            
		            <p:column headerText="Asset Code">
		                <h:outputText value="#{assetRequest.assetReferenceCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{assetRequest.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approver Status">
		                <h:outputText value="#{assetRequest.approverStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{approverInprocessAssetsBean.assetRequestApproveAction}" value="View" >			
							<f:param name="assetCode" value="#{assetRequest.assetReferenceCode}" />							
							<f:param name="activity" value="byApprover" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab3" title="Rejected" >  
					
				  <p:dataTable paginator="true" rows="25" value="#{approverInprocessAssetsBean.assetRequestRejected}" var="assetRequest" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{assetRequest.sno}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{assetRequest.employee.firstName} #{assetRequest.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Request Date">
		                <h:outputText value="#{assetRequest.requestDate}" >
		                	<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{approverInprocessAssetsBean.timeZone}"/>
		                </h:outputText>  
		            </p:column> 
		            
		            <p:column headerText="Asset Code">
		                <h:outputText value="#{assetRequest.assetReferenceCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{assetRequest.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approver Status">
		                <h:outputText value="#{assetRequest.approverStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{approverInprocessAssetsBean.assetRequestApproveAction}" value="View" >			
							<f:param name="assetCode" value="#{assetRequest.assetReferenceCode}" />							
							<f:param name="activity" value="byApprover" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
			
			</p:tabView>
			
		</h:form>
	</ui:define>
</ui:composition>

